//
//  Cliqset.h
//  cliqset
//
//  Created by David Hinson on 2/17/09.
//  Copyright 2009 Cliqset, Inc.. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Contact.h"
#import "Connector.h"

@interface Cliqset : NSObject {	
	
	NSMutableString* currentContact;
	NSMutableString* currentType;
	NSMutableString* currentField;
	BOOL currentFlag;
	int currentIndex;
	
	// --- Address stuff
	NSMutableString* currentStreet;
	NSMutableString* currentLocality;
	NSMutableString* currentRegion;
	NSMutableString* currentPostalCode;
	NSMutableString* currentCountry;

	Contact* currentContactRecord;
	
	BOOL isFavorite;
	
	int currentRelationshipOffset;
}

@property (retain, nonatomic) NSMutableString* currentContact;
@property (retain, nonatomic) NSMutableString* currentType;
@property (retain, nonatomic) NSMutableString* currentField;

@property (retain, nonatomic) NSMutableString* currentStreet;
@property (retain, nonatomic) NSMutableString* currentLocality;
@property (retain, nonatomic) NSMutableString* currentRegion;
@property (retain, nonatomic) NSMutableString* currentPostalCode;
@property (retain, nonatomic) NSMutableString* currentCountry;

@property (retain, nonatomic) Contact* currentContactRecord;

@property BOOL currentFlag;
@property BOOL isFavorite;
@property int currentIndex;

@property int currentRelationshipOffset;

-(void)authenticate;
-(void)getUserContacts:(NSString*)userid reload:(BOOL)reload;
-(void)getUserContacts:(NSString*)userid since:(NSString*)since;

# pragma mark ---- delete functions ----
-(void)deleteUserAddress:(NSString*)cid tag:(NSString*)tag;
-(void)deleteUserContact:(NSString*)cid isFavorite:(BOOL)isFavorite;
-(void)deleteUserEmail:(NSString*)cid tag:(NSString*)tag;
-(void)deleteUserPhone:(NSString*)cid tag:(NSString*)tag;
-(void)deleteUserIM:(NSString*)cid tag:(NSString*)tag;
-(void)deleteUserURL:(NSString*)cid tag:(NSString*)tag;

#pragma mark ---- add / put functions ----
-(void)putAddress:(NSString*)cid tag:(NSString*)tag street:(NSString*)street locality:(NSString*)locality region:(NSString*)region postalCode:(NSString*)postalCode country:(NSString *)country;
-(void)putEmail:(NSString*)cid tag:(NSString*)tag number:(NSString*)number primary:(BOOL)primary;
-(void)putIM:(NSString*)cid tag:(NSString*)tag number:(NSString*)number primary:(BOOL)primary;
-(void)putPhone:(NSString*)cid tag:(NSString*)tag number:(NSString*)number primary:(BOOL)primary;
-(void)putURL:(NSString*)cid tag:(NSString*)tag number:(NSString*)number primary:(BOOL)primary;
-(void)putContact:(Contact*)contact;

#pragma mark ---- logout ----
-(void)logout;

#pragma mark ---- events ----
-(void)loadFromEvents:(NSString*)uid reload:(BOOL)reload;
-(void)loadToEvents;
-(void)loadProfileEvents:(NSString*)uid reload:(BOOL)reload;
-(void)loadProfileEventsBG:(NSString*)uid reload:(BOOL)reload;
-(void)loadRelationshipDrillEvents:(NSString*)uid offset:(int)offset;
-(void)loadRelationshipEvents:(NSString*)uid offset:(int)offset;
-(void)getEventStatus:(NSString*)userid;

#pragma mark ---- status ----
-(void)getCurrentStatus;
-(void)putCurrentStatus:(NSString*)status;

#pragma mark ---- Profile ----

-(void)getProfile;

#pragma mark ---- Relationships ----

-(void)getRelationships;
-(void)getRelationshipStatus:(NSString*)userid;
-(void)getAskedForRelationshipRequests;
-(void)getRelationshipRequests;
-(void)getRelationshipRequestsCount;
-(void)deleteRelationship:(NSString*)userid;
-(void)requestRelationship:(NSString*)userid;

#pragma mark ---- Messages ----
-(void)getMessagesCount;
-(void)getBGMessages;
-(void)getMessages;
-(void)getSentMessages;
-(void)deleteMessage:(NSString*)messageID messageIndex:(int)index;
-(void)getMessage:(NSString*)messageID messageIndex:(int)index;
-(void)sendMessage:(NSString*)subject message:(NSString*)body recipients:(NSArray*)recipients;

#pragma mark ---- Callback ----
-(void)processMessage:(NSData*)data mode:(int)mode;
-(void)didFailWithError:(NSError *)error;

#pragma mark ---- Query ----
-(void)query:(NSString*)query;

@end
